void t1(){
  TFile *f = new TFile(getenv("TMP1"), "UPDATE");
  TTree *etf = (TTree *)f->Get("etf");
  TCut cut = "tstop.GetFiredStatus()==4";

  TCanvas *c = new TCanvas("c", "Tstop Statistics", 1680, 1050);
  c->Divide(3, 2);
  c->cd(1); etf->Draw("tstop.timeL()>>h1(1000, 600., 1200.)", cut);
  c->cd(2); etf->Draw("tstop.timeR()>>h2(1000, 600., 1200.)", cut);
  c->cd(3); etf->Draw("tstop.dt()>>h3(500, -10., 10.)", cut);
  // inspect Tstop timing resolution by tl-tr spectrum //
  TH1 *h3 = (TH1 *)f->Get("h3");
  h3->Fit("gaus");
  TF1 *gaus = h3->GetFunction("gaus");
  const double res = gaus->GetParameter("Sigma")/sqrt(2.)*1000.;
  cout << "Estimated T1 timing resolution: \033[32;1m"
    << res << "\033[0m ps" << endl;
  h3->GetXaxis()->SetTitle("tL-tR [ns]");
  h3->SetTitle(ETFMsg::Form("tL-tR, \\sigma/\\sqrt{2}=%.2f ps", res));

  c->cd(4); etf->Draw("tstop.time()>>h4(1000, 600., 1200.)", cut);
  c->cd(5); etf->Draw("tstop.timeR():tstop.timeL()>>h5(500, 600., 1200., 500, 600., 1200.)", cut, "colz");
  c->cd(6); etf->Draw("-tstop.hitPos()>>h6(500, -400., 400.)", cut);

  char h[64]; TH1 *b;
  for(int i = 0; i < 6; i++){
    sprintf(h, "h%d", i+1); f->GetObject(h,b);
    if(2 != i && 5 != i) b->GetXaxis()->SetTitle("time [ns]");
    if(4 == i) b->GetYaxis()->SetTitle("time [ns]");
    if(5 == i){
      b->SetTitle("Hit Position");
      b->GetXaxis()->SetTitle("hitPos [mm]");
    } // end if
  } // end for
  c->Print("t1.pdf");
} // end vis
